FROM ubuntu:20.04
MAINTAINER author "https://github.com/m986883511"
WORKDIR /m986883511
ENV DOCKER=true
ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && apt install wget file curl vim procps lsof inetutils-ping net-tools -y
RUN apt install python3 python3-pip -y
RUN pip install --upgrade pip

# 解决安装 postgresql lxml Pillow 报错的问题
RUN apt install postgresql libpq-dev libxml2-dev libxslt-dev libjpeg-dev -y
RUN apt install android-tools-adb -y
COPY docker/requirements.txt .
RUN pip3 install -r requirements.txt

# 解决fastapi的docs访问swagger-ui需要联网下载js、css的问题
RUN sed -i 's/https:\/\/fastapi.tiangolo.com\/img/\/static\/swagger-ui/g' /usr/local/lib/python3.8/dist-packages/fastapi/openapi/docs.py && \
    sed -i 's/https:\/\/cdn.jsdelivr.net\/npm\/swagger-ui-dist@3/\/static\/swagger-ui/g' /usr/local/lib/python3.8/dist-packages/fastapi/openapi/docs.py